-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate rendering templates with . in the name #38858
Conversation
Allowing templates with "." introduces some ambiguity. Is index.html.erb a template named "index" with format "html", or is it a template named "index.html" without a format? We know it's probably the former, but if we asked ActionView to render "index.html" we would currently get some combination of the two: a Template with index.html as the name and virtual path, but with html as the format. This deprecates having "." anywhere in the template's name, we should reserve this character for specifying formats. I think in 99% of cases this will be people specifying `index.html` instead of simply `index`. This was actually once deprecated in the 3.x series (removed in 6c57177) but I don't think we can rely on nobody having introduced this in the past 8 years.
Looks like this deprecation message also fires on dynamic renders. We've got a case of:
triggering:
|
Going to revert this for now, because the deprecation warnings is driving me batty. |
Is this revert going into a release anytime soon? Getting tons of these deprecation warnings on 6.1.4 still |
@corytheboyd-cirrusmd Yes, this deprecation shipped in Rails 6.1. In Rails 7.0 attempting to use a In most cases this deprecation warning occurs when trying to render a template like |
@jhawthorn Gotcha, thanks for the quick reply! I was shooting from the hip with that comment amidst a pretty large Rails 6.0 => 6.1 upgrade hah, will actually dig in now and look for those offenses. Cheers 馃嵒 ! |
This change is to address these deprecation warnings, more details in this thread/post: rails/rails#38858 (comment) Refs: #2872
This change is to address these deprecation warnings, more details in this thread/post: rails/rails#38858 (comment) Refs: #2872
This change is to address these deprecation warnings, more details in this thread/post: rails/rails#38858 (comment) Refs: #2872
This change is to address these deprecation warnings, more details in this thread/post: rails/rails#38858 (comment) Refs: #2872
Allowing templates with
.
introduces some ambiguity. Isindex.html.erb
a template namedindex
with formathtml
, or is it a template namedindex.html
without a format? We (humans) know it's probably the former, but if we asked ActionView to renderindex.html
we would currently get some combination of the two: aTemplate
withindex.html
as the name and virtual path, but withhtml
as the format.This deprecates having "." anywhere in the template's name, we should reserve this character for specifying formats. I think in 99% of cases this will be people specifying
index.html
instead of simplyindex
.This was actually once deprecated in the 3.x series (removed in 6c57177) but I don't think we can rely on nobody having introduced this in the past 8 years 馃槄.